package sk.fhi.client.event;

import sk.fhi.shared.model.AbstractEntity;

import com.google.gwt.event.shared.GwtEvent;


public class CreateEvent extends GwtEvent<CreateEventHandler> {

	public static Type<CreateEventHandler> TYPE = new Type<CreateEventHandler>();
	
	private AbstractEntity entity;
	
	public CreateEvent(AbstractEntity entity) {
		super();
		this.entity = entity;
	}

	@Override
	protected void dispatch(CreateEventHandler arg0) {
		arg0.onCreate(this);
	}

	@Override
	public Type<CreateEventHandler> getAssociatedType() {
		return TYPE;
	}

	public AbstractEntity getEntity() {
		return entity;
	}
}
